import {addresslist} from "../../utils/api"
export const state={
    list:[]
}

export const mutations={
    changeaddresslist(state,arr){
        state.list=arr
    }
}

export const actions={
    reqChangeAddresslist(context,obj){
        addresslist(obj).then(res=>{
            let arr=res.data.list?res.data.list:[]
            console.log(arr);
            context.commit("changeaddresslist",arr)
        })
    },
}

export const getters={
    list(state){
    return state.list
    }
}

export default {
    state,
    actions,
    mutations,
    getters,
    namespaced:true,
}